//
//  DemoTabBarViewController.swift
//  swift-practice
//
//  Created by 余振涛 on 2021/7/23.
//

import UIKit

class DemoTabBarViewController: UITabBarController {
    
    init(withTitle title:String){
        super.init(nibName: nil, bundle: nil)
        self.title = title
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        createTab()
        // Do any additional setup after loading the view.
    }
    
    func createTab() {
        let vc1 = UIViewController.init()
        let vc2 = UIViewController.init()
        vc1.view.backgroundColor = .red
        vc2.view.backgroundColor = .green
        
        vc1.tabBarItem.title = "111"
        vc2.tabBarItem.title = "222"
        
        self.addChild(vc1)
        self.addChild(vc2)
    }

}
